<template>
    <el-dialog v-model="visible" title="查看参会历史" :close-on-click-modal="false" :close-on-press-escape="false">
        <el-form label-width="120px" :model="state.dataForm" ref="dataFormRef">
            <el-table :header-cell-style="{ 'background': '#eef1f6', 'color': '#1f2d3d', 'border-color': '#dfe6ec' }"
            v-loading="state.dataListLoading" :data="state.dataList" center border style="width: 100%;margin-top: 15px; ">
            <el-table-column type="selection"></el-table-column>
            <el-table-column align="center" prop="exhName" label="展会名称"  min-width="160"></el-table-column>
            <el-table-column align="center" prop="name" label="姓名"></el-table-column>
            <el-table-column align="center" prop="company" label="公司"  min-width="200" ></el-table-column>
            <el-table-column align="center" prop="position" label="职务"></el-table-column>
            <el-table-column align="center" prop="department" label="部门"></el-table-column>
            <el-table-column align="center" prop="mobile" label="手机" min-width="120"></el-table-column>
            <el-table-column align="center" prop="tel" label="电话"  min-width="120"></el-table-column>
            <el-table-column align="center" prop="fax1" label="传真"></el-table-column>
            <el-table-column align="center" prop="address" label="地址" min-width="200"></el-table-column>
            <el-table-column align="center" prop="email" label="邮箱" min-width="200"></el-table-column>
            <el-table-column align="center" prop="source" label="数据来源" min-width="100"></el-table-column>
            <el-table-column align="center" prop="state" label="参会身份" min-width="100"></el-table-column>
        </el-table>
        </el-form>
    </el-dialog>
</template>
<script lang="ts" setup>
import useView from "@/hooks/useView";
import {reactive, ref, toRefs} from "vue";
import baseService from "@/service/baseService";
import { useRoute } from 'vue-router';

const dataFormRef = ref();
const visible = ref(false);
const view = reactive({
    deleteIsBatch: true,
    dataForm: {
        id: "",
    }
});

//初始化
const init = (id?: Number) => {
    visible.value = true
    // 重置表单数据
    if (dataFormRef.value) {
        dataFormRef.value.resetFields();
    }
};

//接收过来的id
const route = useRoute();
const id = route.query.id;


//页面回显数据
baseService.get("/crm/crmperson/getExhListByPsnId/" + id).then((res) => {
    //Object.assign(res.data);
    state.dataList = res.data;
});

const state = reactive({ ...useView(view), ...toRefs(view) });

//页面进入执行
defineExpose({
    init
});

</script>
<style lang="scss" scoped>
::v-deep .el-table .cell {
  white-space: nowrap;
  }
</style>
